<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VehicleDetails.ascx.cs" Inherits="WebControl.VehicleSearch.VechicleDetails" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="aspext" %>

<div id="divMain" runat="server">
    <h2>
        <asp:Label ID="labelTitle" runat="server" Text="label"></asp:Label>&nbsp;</h2>
    <!-- Vehicle Details -->
    <div class="left">
        <table cellpadding="0" cellspacing="0">
            <tr id="trStockNo" runat="server" visible="false">
                <td class="label" style="width: 80px;">
                    Stock#
                </td>
                <td id="uicStockNo" runat="server" />
            </tr>
            <tr id="trType" runat="server" visible="false">
                <td class="label">
                    Type:
                </td>
                <td id="uicType" runat="server" />
            </tr>
            <tr id="trExtColour" runat="server" visible="false">
                <td class="label">
                    Ext Colour:
                </td>
                <td id="uicExtColour" runat="server" />
            </tr>
            <tr id="trIntType" runat="server" visible="false">
                <td class="label">
                    Int Type:
                </td>
                <td id="uicIntType" runat="server" />
            </tr>
            <tr id="trTransmission" runat="server" visible="false">
                <td class="label">
                    Transmission:
                </td>
                <td id="uicTransmission" runat="server" />
            </tr>
            <tr id="trFuel" runat="server" visible="false">
                <td class="label">
                    Fuel Type:
                </td>
                <td id="uicFuel" runat="server" />
            </tr>
            <tr id="trCC" runat="server" visible="false">
                <td class="label">
                    CC Rating:
                </td>
                <td id="uicCC" runat="server" />
            </tr>
            <tr id="trODO" runat="server" visible="false">
                <td class="label">
                    Odometer:
                </td>
                <td id="uicOdo" runat="server" />
            </tr>
            <tr id="trCondition" runat="server" visible="false">
                <td class="label">
                    Condition:
                </td>
                <td id="uicCondition" runat="server" />
            </tr>
            <tr id="trChassis" runat="server" visible="false">
                <td class="label">
                    Chassis #:
                </td>
                <td id="uicChassis" runat="server" />
            </tr>
            <tr id="trDifferential" runat="server" visible="false">
                <td class="label">
                    Differential:
                </td>
                <td id="uicDiff" runat="server" />
            </tr>
            <tr id="trWheelBase" runat="server" visible="false">
                <td class="label">
                    Wheel Base:
                </td>
                <td id="uicWb" runat="server" />
            </tr>
            <tr id="trPayload" runat="server" visible="false">
                <td class="label">
                    Payload:
                </td>
                <td id="uicPayLoad" runat="server" />
            </tr>
            <tr id="trTare" runat="server" visible="false">
                <td class="label">
                    Tare:
                </td>
                <td id="uicTare" runat="server" />
            </tr>
            <tr id="trDisplacement" runat="server" visible="false">
                <td class="label" id="uicDisplacementTitle" runat="server">
                    Displacement:
                </td>
                <td id="uicDisplacement" runat="server" />
            </tr>
            <tr id="trTyreSize" runat="server" visible="false">
                <td class="label">
                    Tyre Size:
                </td>
                <td id="uicTyreSize" runat="server" />
            </tr>
            <tr id="trAxleConfiguration" runat="server" visible="false">
                <td class="label">
                    Axle Configuration:
                </td>
                <td id="uicAxle" runat="server" />
            </tr>
            <tr id="trEngine" runat="server" visible="false">
                <td class="label">
                    Engine:
                </td>
                <td id="uicEngine" runat="server" />
            </tr>
            <tr id="trHorsepower" runat="server" visible="false">
                <td class="label">
                    Horsepower:
                </td>
                <td id="uicHP" runat="server" />
            </tr>
            <tr id="trDeckLength" runat="server" visible="false">
                <td class="label">
                    Deck Length:
                </td>
                <td id="uicDeckLength" runat="server" />
            </tr>
            <tr id="trLength" runat="server" visible="false">
                <td class="label">
                    Length:
                </td>
                <td id="uicLength" runat="server" />
            </tr>
            <tr id="trHeight" runat="server" visible="false">
                <td class="label" id="uicHeight" runat="server">
                    Height
                </td>
                <td id="uicHeightData" runat="server" />
            </tr>
            <tr id="trWidth" runat="server" visible="false">
                <td class="label" id="uicWidth" runat="server">
                    Width
                </td>
                <td id="uicWidthData" runat="server" />
            </tr>
            <tr id="trSeats" runat="server" visible="false">
                <td class="label">
                    Seats:
                </td>
                <td id="uicSeats" runat="server" />
            </tr>
            <tr id="trFuelCapacity" runat="server" visible="false">
                <td class="label">
                    Fuel Capacity:
                </td>
                <td id="uicFuelCapacity" runat="server" />
            </tr>
            <tr id="trComments" runat="server" visible="false">
                <td class="label" valign="top" style="white-space: nowrap;">
                    Comments:
                </td>
                <td valign="top" style="padding-bottom: 10px;" id="uicComments" runat="server" />
            </tr>
            <tr id="divOptions" runat="server" style="padding-bottom: 10px;">
                <td class="label">
                    Features:
                </td>
                <td>
                    <ul>
                        <asp:DataList ID="RepeaterFeatures" Width="100%" runat="server" RepeatDirection="vertical"
                            RepeatColumns="2" RepeatLayout="Table" CssClass="featureStyle" OnItemDataBound="RepeaterFeatures_ItemDataBound">
                            <ItemTemplate>
                                <li id="liVehicleFeature" runat="server"></li>
                            </ItemTemplate>
                        </asp:DataList>
                    </ul>
                </td>
            </tr>
        </table>
        <div id="divDealercontainer" style="width: 100%;">
            <h3>
                Contact Details:</h3>
            <div id="divDealer" runat="server">
                <!-- Dealer contact box-->
                <aspext:UpdatePanel ID="updatePanelDealerContact" runat="server" ChildrenAsTriggers="true" UpdateMode="Conditional">
                    <ContentTemplate>
                        <table cellpadding="0" cellspacing="0" border="0">
                            <tr>
                                <td style="width: 80px;" class="label">
                                    Dealer
                                </td>
                                <td>
                                    <b>
                                        <asp:HyperLink ID="uicDealer" runat="server">[uicDealer]</asp:HyperLink></b><br />
                                    <asp:HyperLink Text="Contact Dealer" ID="showModalPopupClientButton" NavigateUrl="#"
                                        runat="server"></asp:HyperLink>
                                    <cc1:ModalPopupExtender runat="server" ID="dealerModalPopup" TargetControlID="showModalPopupClientButton"
                                        PopupControlID="programmaticPopup" PopupDragHandleControlID="popupDragHandle"
                                        RepositionMode="None" BackgroundCssClass="modalBackground" BehaviorID="dealerModalPopupBehavior"
                                        DropShadow="true" />
                                    <asp:Panel runat="server" CssClass="modalPopup" ID="programmaticPopup">
                                        <asp:Panel runat="Server" ID="popupDragHandle" CssClass="modalPopupDragHandle">
                                            <asp:Label ID="uicHeader" runat="server"></asp:Label>
                                        </asp:Panel>
                                        <asp:Panel runat="Server" ID="popupBody" Width="320px">
                                            <table width="100%" border="0" cellspacing="1" cellpadding="2">
                                                <tr>
                                                    <td colspan="2">
                                                        <span style="color: #bbbbbb; font-style: italic;">Enter your Message/Question in the
                                                            space provided bellow</span>
                                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ValidationGroup="ContactDealer"
                                                            ControlToValidate="uicMessage" ErrorMessage="Please enter your Question.">*</asp:RequiredFieldValidator>
                                                        <asp:TextBox ID="uicMessage" runat="server" Height="102px" TextMode="MultiLine" Width="100%"></asp:TextBox>
                                                        <div style="width: 100%; float: left;" class="horRule" />
                                                    </td>
                                                </tr>
                                                <tr id="divMemberName" runat="server">
                                                    <td class="label" bgcolor="#eeeeee" style="width: 100px;">
                                                        Your Name:<asp:RequiredFieldValidator ID="RequiredFieldValidator2" ValidationGroup="ContactDealer"
                                                            runat="server" ControlToValidate="uicName" ErrorMessage="Please enter your Name.">*</asp:RequiredFieldValidator>
                                                    </td>
                                                    <td bgcolor="#eeeedd">
                                                        <span style="color: red; font-size: 9px; font-style: italic;">
                                                            <asp:TextBox ID="uicName" runat="server" Width="150px"></asp:TextBox>* Required
                                                            Field</span>
                                                    </td>
                                                </tr>
                                                <tr id="divMemberEmail" runat="server">
                                                    <td class="label" bgcolor="#eeeeee">
                                                        Your Email:<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server"
                                                            ControlToValidate="uicEmail" ErrorMessage="Please enter an Email Address.">*</asp:RequiredFieldValidator>
                                                        <asp:RegularExpressionValidator ValidationGroup="ContactDealer" ID="RegularExpressionValidator1"
                                                            runat="server" ControlToValidate="uicEmail" ErrorMessage="Please enter a valid Email Address."
                                                            ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">*</asp:RegularExpressionValidator>
                                                    </td>
                                                    <td bgcolor="#eeeedd">
                                                        <span style="color: red; font-size: 9px; font-style: italic;">
                                                            <asp:TextBox ID="uicEmail" runat="server" Width="150px"></asp:TextBox>* Required
                                                            Field</span>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td class="label" bgcolor="#eeeeee">
                                                        Your Phone:<asp:CustomValidator ID="CustomValidator1" ValidationGroup="ContactDealer"
                                                            runat="server" ClientValidationFunction="IsValidNumeric" ControlToValidate="uicPhone"
                                                            OnServerValidate="CustomValidator_ServerValidate" ErrorMessage="Please enter numbers only in the phone field.<br/>Remove any spaces, brackets or dashes that may be there">*</asp:CustomValidator>
                                                    </td>
                                                    <td bgcolor="#eeeedd">
                                                        <small>
                                                            <asp:TextBox ID="uicPhone" runat="server" Width="150px"></asp:TextBox>
                                                            <i>Leave blank if you do not want to be contacted by phone</i></small>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td class="label" bgcolor="#eeeeee">
                                                        Your Mobile:<asp:CustomValidator ID="CustomValidator2" ValidationGroup="ContactDealer"
                                                            runat="server" ClientValidationFunction="IsValidNumeric" ControlToValidate="uicMobile"
                                                            ErrorMessage="Please enter numbers only in the mobile field.<br/>Remove any spaces, brackets or dashes that may be there">*</asp:CustomValidator>
                                                    </td>
                                                    <td bgcolor="#eeeedd">
                                                        <asp:TextBox ID="uicMobile" runat="server" Width="150px"></asp:TextBox>
                                                        <small><i>Leave blank if you do not want to be contacted by mobile</i></small>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td colspan="2">
                                                        <div style="width: 100%; float: left;" class="horRule" />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td colspan="2" align="CENTER">
                                                        <a id="uicCancel" href="#">
                                                            <img id="Img1" alt="" src="~/Images/buttons/cancel.gif" style="cursor: pointer; border: none;"
                                                                runat="server" />
                                                        </a>
                                                        <asp:ImageButton ID="uicSend" runat="server" ValidationGroup="ContactDealer" ImageUrl="~/images/buttons/send.gif"
                                                            OnClick="uicButton_Click" />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td colspan="2">
                                                        <asp:ValidationSummary ValidationGroup="ContactDealer" ID="ValidationSummary1" runat="server" />
                                                    </td>
                                                </tr>
                                            </table>
                                        </asp:Panel>
                                    </asp:Panel>
                                    <script type="text/javascript">
                                        // Add click handlers for buttons to show and hide modal popup on pageLoad
                                        function pageLoad(){
                                            $addHandler($get("uicCancel"), 'click', hidePopup);
                                        }

                                        function hidePopup(ev) {
                                            ev.preventDefault();
                                            var modalPopupBehavior = $find('dealerModalPopupBehavior');
                                            var textControl = document.getElementById('<%=uicMessage.ClientID%>')
                                            textControl.value = '';
                                            textControl = document.getElementById('<%=uicName.ClientID%>')
                                            textControl.value = '';
                                            textControl = document.getElementById('<%=uicEmail.ClientID%>')
                                            textControl.value = '';
                                            textControl = document.getElementById('<%=uicPhone.ClientID%>')
                                            textControl.value = '';
                                            textControl = document.getElementById('<%=uicMobile.ClientID%>')
                                            textControl.value = '';
                                            modalPopupBehavior.hide();
                                        }
                                    </script>
                                </td>
                            </tr>
                            <tr>
                                <td id="lableController" runat="server" class="label">
                                    Address
                                </td>
                                <td id="lblAddress" runat="server" />
                            </tr>
                            <tr>
                                <td class="label">
                                    Phone
                                </td>
                                <td id="lblPhone" runat="server" />
                            </tr>
                            <tr id="divName" runat="server">
                                <td class="label">
                                    Contact
                                </td>
                                <td id="lblStaffName" runat="server" />
                            </tr>
                        </table>
                    </ContentTemplate>
                </aspext:UpdatePanel>
                <!-- Dealer contact box End-->
            </div>
        </div>
        <div id="divError" runat="server">
            <asp:Label ID="lblDealerNotFound" runat="server" Text="We're sorry, but the dealer cannot be found for this vehicle."
                Width="353px"></asp:Label>
        </div>
    </div>
    <!-- Vehicle Details End-->
    <!-- Vehicle Images -->
    <div class="right" >
        <div class="gallery">
            <asp:Repeater ID="repeaterVehicleImages" runat="server" OnItemDataBound="repeaterVehicleImages_ItemDataBound">
                <ItemTemplate>
                <!--REX-->
                <!--
                    <a rel="lightbox" id="vehicleImageLink" runat="server" >
                        <img alt="car" id="vehicleImage" src="" runat="server" />
                    </a>
                    <asp:Label Visible="false" ID="vehicleIndex" runat="server" ></asp:Label>
                    -->
                </ItemTemplate>
            </asp:Repeater>
        </div>
        <div class="section">
            <h3>
                User Options</h3>
            <ul>
                <li>
                    <asp:HyperLink ID="uicPrint" runat="server" Target="_blank" Width="122px">Print Vehicle Card</asp:HyperLink>
                </li>
                <li>
                    <asp:HyperLink ID="uicWww" runat="server"></asp:HyperLink>
                </li>
                <li>
                    <asp:HyperLink ID="uicBack" runat="server" Text="Back to List"></asp:HyperLink>
                </li>
            </ul>
        </div>
    </div>
    <!-- Vehicle Images End-->
    <!-- Light Box -->
    <div id="lightbox" style="display: none;">
        <div id="lightboxHeader" style="width: 100%;">
            <table width="100%" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td>
                        <table width="100%" border="0" cellpadding="0" cellspacing="0" id="lightboxNav">
                            <tr>
                                <td id="lightboxNavPrevious">
                                    <img src="Images/lightbox_previous.gif" onclick="lightboxMovePrevious();" alt="Use Left Arrow key on your keyboard." />
                                </td>
                                <td id="lightboxNavInfo">
                                </td>
                                <td id="lightboxNavNext">
                                    <img src="images/lightbox_next.gif" onclick="lightboxMoveNext();" alt="Use Right Arrow key on your keyboard." />
                                </td>
                                <td class="lightboxKeysTips" style="padding-left: 10px;">
                                    (Use Left &amp; Right Arrow keys)
                                </td>
                            </tr>
                        </table>
                    </td>
                    <td align="right">
                        <div id="lightboxClose" onclick="hideLightbox();">
                            Close&nbsp;<span class="lightboxKeysTips">(Esc)</span>&nbsp;<img align="absmiddle"
                                src="/images/lightbox_close.gif" alt="Use Esc key on your keyboard.">
                        </div>
                    </td>
                </tr>
            </table>
        </div>
        <div id="lightboxBody" style="width: 100%;">
            <table border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td valign="top" style="padding: 10 10 10 10;">
                        <img width="640" runat="server" id="lightboxMainImage" name="lightboxMainImage" src="" />
                    </td>
                    <td valign="top" align="right" style="padding-top: 10px; padding-bottom: 10px; padding-right: 8px;">
                        <table id="lightboxThumbs" runat="server" border="0" cellpadding="0" cellspacing="0">
                        </table>
                    </td>
                </tr>
            </table>
        </div>
    </div>
    <asp:PlaceHolder ID="placeHolderJs" runat="server"></asp:PlaceHolder>
    <!-- Light Box End-->
</div>
<div id="divNoVehicle" runat="server">
    Vehicle not found
</div>